﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Aga.GestionDeArchivos.Services.Dtos
{
    public class ClienteDto : IDomainDto
    {
        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>The id.</value>
        public int Id { get; set; }

        /// <summary>
        /// Gets or sets the nombre.
        /// </summary>
        /// <value>The nombre.</value>
        public string Nombre { get; set; }

        /// <summary>
        /// Gets or sets the direccion.
        /// </summary>
        /// <value>The direccion.</value>
        public string Direccion { get; set; }

        /// <summary>
        /// Gets or sets the localidad.
        /// </summary>
        /// <value>The localidad.</value>
        public string Localidad { get; set; }

        /// <summary>
        /// Gets or sets the codigo postal.
        /// </summary>
        /// <value>The codigo postal.</value>
        public string CodigoPostal { get; set; }

        /// <summary>
        /// Gets or sets the provincia.
        /// </summary>
        /// <value>The provincia.</value>
        public string Provincia { get; set; }

        /// <summary>
        /// Gets or sets the cuit.
        /// </summary>
        /// <value>The cuit.</value>
        public string Cuit { get; set; }

        /// <summary>
        /// Gets or sets the telefonos.
        /// </summary>
        /// <value>The telefonos.</value>
        public string Telefonos { get; set; }

        /// <summary>
        /// Gets or sets the fax.
        /// </summary>
        /// <value>The fax.</value>
        public string Fax { get; set; }

        /// <summary>
        /// Gets or sets the web.
        /// </summary>
        /// <value>The web.</value>
        public string Web { get; set; }

        /// <summary>
        /// Gets or sets the email.
        /// </summary>
        /// <value>The email.</value>
        public string Email { get; set; }

        /// <summary>
        /// Gets or sets the observaciones.
        /// </summary>
        /// <value>The observaciones.</value>
        public string Observaciones { get; set; }

        /// <summary>
        /// Gets or sets the tipo.
        /// </summary>
        /// <value>The tipo.</value>
        public int Tipo { get; set; }

        /// <summary>
        /// Gets or sets the ex id.
        /// </summary>
        /// <value>The ex id.</value>
        public int? ExId { get; set; }

        /// <summary>
        /// Gets or sets the cajas.
        /// </summary>
        /// <value>The cajas.</value>
        public List<CajaClienteDto> Cajas { get; set; }

        /// <summary>
        /// Gets or sets the responsable.
        /// </summary>
        /// <value>The responsable.</value>
        public string Responsable { get; set; }

        /// <summary>
        /// Gets or sets the responsable' email.
        /// </summary>
        /// <value>The email responsable.</value>
        public string EmailResponsable { get; set; }
        
        public string FormattedAddress()
        {
            if (!String.IsNullOrEmpty(Direccion))
                return String.Format("{0}, {1} ({2}), {3}", Direccion, Localidad, CodigoPostal, Provincia);
            else
                return String.Empty;
        }
    }
}
